<?php /* Smarty version 2.6.16, created on 2011-10-13 14:07:59
         compiled from findcoach2.tpl */ ?>
<?php echo '
<script>
function ListSorting(sorting_url,sorting_by)
{
var params = {
	\'list_for\':\'sorting\',
	\'sorting_by\': sorting_by,
	\'IsProcess\': \'Y\'
};

$.ajax({
	type: "GET",
	url: sorting_url,
	data: params,			
	dataType: \'html\',
	success: function(data)
	{				
		$("#paging").html(data);
	}
});
return false;		
}

</script>
<script type="text/javascript">
function redirect_function(id)
{
  document.forms["coachform"+id].submit();
}
</script>
'; ?>

<div id="paging"> 
 <div class="right-panel">
      <h1><span>Find Coach</span></h1>
      <div class="searchpanel">
         <form action="" method="post">
              <fieldset>
			  <label></label>
              <select for="sirt" name="sort_by" onchange="ListSorting('findcoach.php',this.value)">
                  <option value="ASC" <?php if ($this->_tpl_vars['sort_by'] == 'ASC'): ?> selected="selected" <?php endif; ?>>Star Rating (Low)</option>
				  <option value="DESC" <?php if ($this->_tpl_vars['sort_by'] == 'DESC'): ?> selected="selected" <?php endif; ?>>Star Rating (High)</option>
               </select>
               </fieldset>
            </form>
           <div class="clear"></div>
      </div>
      <div class="clear"></div>
      <!--div class="sortby">
             <form action="" method="post">
			   <fieldset>
               <label>Sort by:</label>
               <select for="sirt" name="sort_by" onchange="ListSorting('findcoach.php',this.value)">
                  <option value="ASC" <?php if ($this->_tpl_vars['sort_by'] == 'ASC'): ?> selected="selected" <?php endif; ?>>Star Rating (Low)</option>
				  <option value="DESC" <?php if ($this->_tpl_vars['sort_by'] == 'DESC'): ?> selected="selected" <?php endif; ?>>Star Rating (High)</option>
               </select>
               </fieldset>
            </form>
      </div-->
      <div class="clear"></div>
 

   <?php if ($this->_tpl_vars['SearchTxt'] != ''): ?><div><b>Search By</b>  <?php echo $this->_tpl_vars['SearchTxt']; ?>
</div><?php endif; ?>
	 <?php if ($this->_tpl_vars['NumCoach'] > 0): ?>
	  <?php unset($this->_sections['coachRow']);
$this->_sections['coachRow']['name'] = 'coachRow';
$this->_sections['coachRow']['loop'] = is_array($_loop=$this->_tpl_vars['CoachArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['coachRow']['show'] = true;
$this->_sections['coachRow']['max'] = $this->_sections['coachRow']['loop'];
$this->_sections['coachRow']['step'] = 1;
$this->_sections['coachRow']['start'] = $this->_sections['coachRow']['step'] > 0 ? 0 : $this->_sections['coachRow']['loop']-1;
if ($this->_sections['coachRow']['show']) {
    $this->_sections['coachRow']['total'] = $this->_sections['coachRow']['loop'];
    if ($this->_sections['coachRow']['total'] == 0)
        $this->_sections['coachRow']['show'] = false;
} else
    $this->_sections['coachRow']['total'] = 0;
if ($this->_sections['coachRow']['show']):

            for ($this->_sections['coachRow']['index'] = $this->_sections['coachRow']['start'], $this->_sections['coachRow']['iteration'] = 1;
                 $this->_sections['coachRow']['iteration'] <= $this->_sections['coachRow']['total'];
                 $this->_sections['coachRow']['index'] += $this->_sections['coachRow']['step'], $this->_sections['coachRow']['iteration']++):
$this->_sections['coachRow']['rownum'] = $this->_sections['coachRow']['iteration'];
$this->_sections['coachRow']['index_prev'] = $this->_sections['coachRow']['index'] - $this->_sections['coachRow']['step'];
$this->_sections['coachRow']['index_next'] = $this->_sections['coachRow']['index'] + $this->_sections['coachRow']['step'];
$this->_sections['coachRow']['first']      = ($this->_sections['coachRow']['iteration'] == 1);
$this->_sections['coachRow']['last']       = ($this->_sections['coachRow']['iteration'] == $this->_sections['coachRow']['total']);
?>
      <div class="game-list">
        
		    <div class="game-image">
			<?php if ($this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['photo'] != ''): ?>
		     <img src="uploaded/user_images/thumbs/big_<?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['photo']; ?>
" alt="Coach" border="0"  />
			<?php else: ?>
			 <img src="images/coach_thumb.jpg">
			 <!--div style="width:198px; padding:5px; float:left; display:block;">&nbsp;</div--> 
		  <?php endif; ?> 
		    </div> 
		  
		  <div class="game-details">
             <h2><?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['name']; ?>
</h2>
            <p><?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['about']; ?>
</p>
            <p class="clear"></p>
            <ul class="games-desc">
			   <li><span>Language :</span> <?php if ($this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['language'] != ''):  echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['language'];  else: ?>N/A<?php endif; ?></li>
			   <li><span>Rate :</span> <?php if ($this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['rate'] != ''): ?>$<?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['rate'];  else: ?>N/A<?php endif; ?></li>
			   <?php if ($this->_tpl_vars['is_ladder'] == 'Y'): ?>
			     <li><span>Ladder :</span> <?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['ladder']; ?>
</li>
			   <?php endif; ?>
			   <?php if ($this->_tpl_vars['is_server'] == 'Y'): ?>
                 <li><span>Server :</span> <?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['server']; ?>
</li>
			   <?php endif; ?>
			   <?php if ($this->_tpl_vars['is_region'] == 'Y'): ?>
                 <li><span>Region :</span> <?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['region']; ?>
</li>
			   <?php endif; ?>	 
               
               <!--li><span>Rate :</span> $10</li-->
               
            </ul>
            <ul class="games-desc">
			   <li><span>Star Rating :</span> <?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['star']; ?>
</li>
			   <li><span>Experience :</span> <?php if ($this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['experience'] != ''):  echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['experience'];  else: ?>N/A<?php endif; ?></li>
			   <?php if ($this->_tpl_vars['is_race'] == 'Y'): ?>
                 <li><span>Race :</span> <?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['race']; ?>
</li>
			   <?php endif; ?>
               <?php if ($this->_tpl_vars['is_rating'] == 'Y'): ?>
                 <li><span>Rating :</span> <?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['rating']; ?>
</li>
			   <?php endif; ?>
              
            </ul>
            <div class="clear"></div>
			<form name="coach<?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['user_id']; ?>
" id="coachform<?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['user_id']; ?>
" method="post" 
			action="coachdetails.php?coach_id=<?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['user_id']; ?>
">
			<input type="hidden" name="ladders" value="<?php echo $this->_tpl_vars['ladders']; ?>
" />
			<input type="hidden" name="price" value="<?php echo $this->_tpl_vars['price']; ?>
" />
			<input type="hidden" name="races" value="<?php echo $this->_tpl_vars['races']; ?>
" />
			<input type="hidden" name="ladders" value="<?php echo $this->_tpl_vars['ladders']; ?>
" />
			<input type="hidden" name="ratings" value="<?php echo $this->_tpl_vars['ratings']; ?>
" />
			<input type="hidden" name="servers" value="<?php echo $this->_tpl_vars['servers']; ?>
" />
			<input type="hidden" name="languages" value="<?php echo $this->_tpl_vars['languages']; ?>
" />
			<input type="hidden" name="regions" value="<?php echo $this->_tpl_vars['regions']; ?>
" />
			<input type="hidden" name="availabilitys" value="<?php echo $this->_tpl_vars['availabilitys']; ?>
" />
			<input type="hidden" name="game_id" value="<?php echo $this->_tpl_vars['game_id']; ?>
" />
            <div class="view">
			<!--a href="coachdetails.php?coach_id=<?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['user_id']; ?>
&game_id=<?php echo $this->_tpl_vars['game_id']; ?>
">view</a-->
			<a href="#" onclick="redirect_function(<?php echo $this->_tpl_vars['CoachArr'][$this->_sections['coachRow']['index']]['user_id']; ?>
)">view</a>
			</div>
			</form>
         </div>
         <div class="clear"></div>
      </div>
	 <?php endfor; endif; ?> 
     <?php if ($this->_tpl_vars['pagination_arr'][1]): ?>
	 <div class="clear"></div>
      <div class="pagin">
         <ul>
           <?php echo $this->_tpl_vars['pagination_arr'][1]; ?>

         </ul>
      </div>
	 <?php endif; ?>
	 <?php else: ?>
	    No Coach is found......
     <?php endif; ?>
	</div> 
   </div>